package com.dd.edu.flashsale.portal;

import com.dd.edu.flashsale.portal.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootApplication
public class EduFlashsalePortalApplication {

    public static void main(String[] args) {
        SpringApplication.run(EduFlashsalePortalApplication.class, args);
    }

    @Autowired
    private RedisTemplate<String, Integer> redisTemplate;

    @Bean
    public CommandLineRunner runner() {
        return args -> redisTemplate.opsForValue().set(OrderService.REDIS_GOODS_COUNT, 5);
    }
}

